﻿using System;
using System.Runtime.InteropServices;

namespace WMemoryProfiler
{
    /// <summary>
    /// Helper Native methods
    /// </summary>
    public static class NativeMethods
    {
        /// <summary>
        /// See MSDN
        /// </summary>
        /// <param name="process"></param>
        /// <param name="wow64Process"></param>
        /// <returns></returns>
        [DllImport("kernel32.dll", SetLastError = true, CallingConvention = CallingConvention.Winapi)]
        [return: MarshalAs(UnmanagedType.Bool)]
        internal static extern bool IsWow64Process([In] IntPtr process, [Out] out bool wow64Process);

        /// <summary>
        /// See MSDN
        /// </summary>
        /// <param name="hProcess"></param>
        /// <param name="uExitCode"></param>
        /// <returns></returns>
        [DllImport("kernel32.dll", SetLastError = true)]
        [return: MarshalAs(UnmanagedType.Bool)]
        public static extern bool TerminateProcess(IntPtr hProcess, uint uExitCode);
    }
}
